package jdbc;

public class Demo2 {
    public static void main(String[] args) {
        String[] ss = {"00:00", "11:11", "22:22", "33:33"};
        for (String s : ss) {
            if (s.matches("[01][0-9]:[0-5][0-9]")) {
                System.out.println(s + "匹配12小时制");
            } else {
                System.out.println(s + "不匹配12小时制");
            }
            if (s.matches("[01][0-9]:[0-5]\\d")) {
                System.out.println(s + "匹配12小时制");
            } else {
                System.out.println(s + "不匹配12小时制");
            }

        }
    }
}
